<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>登录</title>
	<link rel="stylesheet" href="../css/bootstrap.min.css" />
	<link rel="stylesheet" href="../css/style.css" />
</head>
<body>
    <div class="landing-bg">
        <div class="landing-frame">
            <div class="adhibition-name">
                <span>原力防护</span>
            </div>
            <img src="../img/landing-frame.png">
            <div class="landing-user">
                <div class="user-landing-title">用户登录</div>
                <div class="landing-phone">
                    <input type="text" value="" class="phone-input-bg js-phone" placeholder="请输入手机号码">
                </div>
                <div class="landing-verification">
                    <input type="text" value="" class="verification-input-bg" placeholder="请输入验证码">
                    <input type="text" value="获取验证码" class="verification-button js-verification" readonly="readonly" id="acquireCode">
                </div>
                <div class="register-button js-register">登录</div>
            </div>
            <div class="company-name">广东原昇信息科技有限公司</div>
        </div>
    </div>   
</body>
<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function(){
    var t1 = null;
    // 获取验证码
    $("#acquireCode").click(function(){
        var jsPhone = $(".js-phone").val();
        if (jsPhone == ""){
            alert("请输入手机号码");
        } else if (!(/^1[34578]\d{9}$/.test(jsPhone))) {
            alert("手机格式不对");
        } else {
            countdown($(this));
        }
    })

    $(".js-register").click(function(){
        var jsPhone = $(".js-phone").val();
        var jsVerification = $(".js-verification").val();
        if (jsPhone == "" || jsVerification == "") {
            alert("手机或验证码输入错误");
        } else {
            window.location.href="../inedx.html"
        }
    })

    function countdown(obj) {
        var count = 60;
        $(obj).css({ background: '#e7e7e7' }).val(count.toString() + "秒").attr('disabled', 'disabled');

        var doCount = function () {
            if (--count < 1) {
                var t2 = clearInterval(t1);
                $(obj).css({ background: '#e7e7e7' }).val('重新发送').removeAttr('disabled');
            }
            else {
                $(obj).val(count.toString() + "秒");
            }
        };

        t1 = setInterval(function () { doCount(); }, 1000);

    }
})
</script>
</html>